//
//  NewChangeSecondViewController.m
//  wangzhe
//
//  Created by 李 佳伟 on 2018/4/2.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "NewChangeSecondViewController.h"
#import "JTCSM.h"
#import "UITextField+PassWord.h"
static CGFloat space = 20;
@interface NewChangeSecondViewController ()<UIAlertViewDelegate>
@property (nonatomic,strong) UITextField *mypasswordTextfield;
@end

@implementation NewChangeSecondViewController

- (void)gotBack{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.navigationBar.hidden = NO;
    [self.view setBackgroundColor:RGBACOLOR(241, 241, 241, 1)];
    [df isRemoveTarbar:YES];
    leftBarButtonItems_rightBarButtonItems *leftbtn = KCUSTOMNAVIGSTION_ALLOC;
    self.navigationItem.leftBarButtonItem = [leftbtn setBarButtonItemsImageName:@"fanhui.png" frame:KLeftBarButtonItemFrame_image target:self SEL:@selector(gotBack)];
    // Do any additional setup after loading the view.
    
    UIView *headerView = [[UIView alloc]initWithFrame:CGRectMake(0, KagainChangeHeight+10, KCONTROLLERWith, 50)];
    headerView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:headerView];
    self.mypasswordTextfield = [[UITextField alloc]initWithFrame:CGRectMake(space, 0, KCONTROLLERWith-2*space, headerView.LC_height)];
    [self.mypasswordTextfield setTextFieldWithFont:14 color:[df colorWithHexString:@"333333" alpha:1] alignment:NSTextAlignmentLeft title:@"" placeHolder:@"请输入当前登录密码" isSelect:NO];
    [headerView addSubview:self.mypasswordTextfield];
    [df newlineViewWithHeightofTop:headerView.LC_height superView:headerView spacing:20 color:RGBACOLOR(241, 241, 241, 1) lineHeight:1];
    
    UIView *bottomeView = [[UIView alloc]initWithFrame:CGRectMake(0, KVIEW_Y(headerView), KCONTROLLERWith, 50)];
    bottomeView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:bottomeView];
    self.mypasswordTextfield = [[UITextField alloc]initWithFrame:CGRectMake(space, 0, KCONTROLLERWith-2*space, bottomeView.LC_height)];
    [self.mypasswordTextfield setTextFieldWithFont:14 color:[df colorWithHexString:@"333333" alpha:1] alignment:NSTextAlignmentLeft title:@"" placeHolder:@"请输入当前登录密码" isSelect:YES];
    [bottomeView addSubview:self.mypasswordTextfield];
    
    CGFloat btnspace = 20;
    CGFloat btnHeight = 50;
    UIButton *LoginBtn =[[UIButton alloc] initWithFrame:CGRectMake(btnspace, KVIEW_Y(bottomeView)+30 , (KCONTROLLERWith-2*btnspace), btnHeight)];
    LoginBtn.backgroundColor =KZhuTiRGB;
    [LoginBtn setTitle:@"确定" forState:UIControlStateNormal];
    [LoginBtn setTitleColor:[df colorWithHexString:@"333333" alpha:1] forState:UIControlStateNormal];
    LoginBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    [LoginBtn addTarget:self action:@selector(gotoMainV) forControlEvents:UIControlEventTouchUpInside];
    LoginBtn.tag = 10002;
    [self.view addSubview:LoginBtn];
    [df layerWithView:LoginBtn radius:btnHeight/2 width:0 color:nil];
    
    // Do any additional setup after loading the view.
}
- (void)gotoMainV{
    [df showAlertWithTitle:@"修改密码成功" message:nil btn1:@"确认" btn2:nil btn3:nil delegate:self tag:100];
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    if (alertView.tag == KAlertVTag +100) {
        UIViewController *viewCtl = self.navigationController.viewControllers[2];
        [self.navigationController popToViewController:viewCtl animated:YES];
        
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
